import Vue from 'vue';
import Vuex from 'vuex';


Vue.use(Vuex);

const store = new Vuex.Store({

	state: {
	    ClassIndex:uni.getStorageSync('classifty'),
		userInfo: uni.getStorageSync('userInfo'),
		userAddress:uni.getStorageSync('userAddress'),
	
	},
	mutations: {
        SET_USERINFO(state, val){
			state.userInfo = val;
			uni.setStorageSync('userInfo', val)	
		},
	  
		SET_LOCATION(state, val){
			state.userAddress = val
			uni.setStorageSync('userAddress', val)	
		},
		
		SET_CLASS(state, val){
			state.ClassIndex = val
			uni.setStorageSync('classifty', val)	
		},
		
		ROMOVE_CURRENT(state, val){
			state.ClassIndex = val
			uni.removeStorageSync('classifty')	
		},

	},
	actions: {
      
	},
	getters: {
         
	}
});

export default store;
